<!DOCTYPE html>
<html lang="en">
<head>
    <!-- BEGIN META -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Olive Enterprise">
    <!-- END META -->
    <title>员工自助修改信息审核页面</title>
    <link href="__PUBLIC__/User/update/css/layui/src/css/layui.css" rel="stylesheet">
    <link rel="shortcut icon" type="image/x-icon"  href="__PUBLIC__/User/update/img/ooopic_1497861131.ico">
    <!-- BEGIN STYLESHEET-->
    <link href="__PUBLIC__/User/update/css/bootstrap3.3.4.css" rel="stylesheet">
    <link href="__PUBLIC__/User/update/css/bootstrap-reset.css" rel="stylesheet">
    <link href="__PUBLIC__/User/update/css/style.css" rel="stylesheet">
    <link href="__PUBLIC__/User/update/css/style-responsive.css" rel="stylesheet">
    <link href="__PUBLIC__/User/update/assets/morris.js-0.4.3/morris.css" rel="stylesheet">

    <script src="__PUBLIC__/User/update/js/jquery.js" ></script>
    <script src="__PUBLIC__/User/update/css/layer/layer/layer.js" ></script>
    <link href="__PUBLIC__/User/update/css/clndr.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <script src="__PUBLIC__/User/update/js/html5shiv.js">
    </script>
    <script src="__PUBLIC__/User/update/js/respond.min.js">
    </script>
    <![endif]-->
    <style>
        body{
            font-family: '微软雅黑';
            background: #fff;
        }
        .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td{
            line-height: 1.0 !important;
        }
        /**郑春阳*/
        .control-label{
            width: 25%;
            font-size:12px !important;
            font-weight: normal !important;
            color: rgb(51,51,51);
            margin-top: 3px;
        }
        .sp_result{
            font-size:12px !important;
            font-weight: normal !important;
            color: rgb(51,51,51);
        }
        .change_content{
            font-size:13px !important;
            font-weight: bold !important;
            color: rgb(51,51,51);
            text-align:center;
        }
        .adv-table table tr td{
            padding: 4px;
        }
        .form-control[readonly],input[readonly],input[disabled]{
            margin:0;
            background: #fff !important;
            /*border: 1px solid #ccc;*/
            border-radius:1px;
            padding: 4px;
            height: 27px;
            color:#333333;
            line-height: 31px;
            font-size: 12px;
            text-align: center;
            border: none;
        }
        .form-group>label {
            margin-top: 8px;
        }
        .layer_input input{
            border: 1px solid #ccc !important;
        }
        .zd_table,.gradeX{
            color: rgb(51,51,51);
        }
        .gradeX{
            font-size: 12px;
        }
        /*文件上传列表*/
        .layui-layer-molv .layui-layer-title{
            color:#5B636B;
            background: #fff;
            padding: 0;
            text-align: center;
        }
        .layui-layer-dialog .layui-layer-content{
            padding-top: 0;
            padding-bottom: 0;
        }
        .layui-layer-btn{
          text-align: center;
        }
        .layui-layer-molv .layui-layer-btn a{
            background: #3383da;
        }
        .file_handle>span{
            margin-left: 20px;
            font-size:14px;
        }
        .file_area tr>td:nth-child(1){
            width: 60%;
            font-size:14px;
        }
        span.form-control.baseinfo_content{
            text-align: left !important;
        }
        .table{
            margin-bottom:0;
        }
        /*修改结束*/
        .control-label{
            width: 25%;
        }
        .col-sm-3{
            padding-left: 0px;
        }

        .col-sm-9{
            padding-left: 0px;
        }
        .yy{
            border:1px solid #ccc !important;
            color:rgb(51,51,51) !important;
            background: #fff !important;
            text-align: left !important;
        }
        .sx{
            margin-right:50px;
            font-size:16px;
        }
        .sx input{
            width:16px;
            height:16px;
        }
        .zj input{
            width:13px;
            height:13px;
        }
        /*个人信息修改前后*/
        .base_info{
            font-size: 16px;
            font-weight: bold;
        }
        .filebtn{
            width:71px;
            background-color: #ccc;
            border: 1px solid #ccc;
            padding: 6px 12px;
            color: rgb(51,51,51);
            display: block;
            margin: 1px auto;
        }
    </style>
</head>
<body>
<!-- BEGIN PANEL SECTION -->
<section class="panel">
    <div >
        <div class="adv-table">
            <table  class="display table table-bordered" >
                <!------------------------------四项基本信息开始------------------------------->
                <tr class="gradeX">
                    <td class="col-sm-3 col-sm-3 control-label">
                        <div class="form-group">
                            <label class="col-sm-3 col-sm-3 control-label change_content">员工姓名</label>
                            <div class="col-sm-9">
                                <span class="form-control baseinfo_content"  readonly style="display: block;
    line-height: 20px;"><?php echo $user_name;?></span>
                                <input type="hidden" id="awsid" value="{$awsid}">
                            </div>
                        </div>
                    </td>
                    <td class="col-sm-3 col-sm-3 control-label">
                        <div class="form-group">
                            <label class="col-sm-3 col-sm-3 control-label change_content">员工编号</label>
                            <div class="col-sm-9">
                                <span class="form-control baseinfo_content" readonly style="display: block;
    line-height: 20px;"><?php echo $uuid;?></span>
                            </div>
                        </div>
                    </td>
                    <td class="col-sm-3 col-sm-3 control-label">
                        <div class="form-group">
                            <label class="col-sm-3 col-sm-3 control-label change_content">员工部门</label>
                            <div class="col-sm-9">
                                <span class="form-control baseinfo_content" style="cursor:pointer;display: block; line-height: 20px;" title="<?php echo $bumen_name;?>" readonly ><?php echo $bumen_name;?></span>
                            </div>
                        </div>
                    </td>
                </tr>
                <tr class="gradeX">
                    <td class="col-sm-4 col-sm-4 control-label">
                        <div class="form-group">
                            <label class="col-sm-3 col-sm-3 control-label change_content">证件类型</label>
                            <div class="col-sm-9">
                                <span class="form-control baseinfo_content" style="cursor:pointer;display: block;line-height: 20px;"  readonly ><?php echo $zjlx_name;?></span>
                            </div>
                        </div>
                    </td>
                    <td class="col-sm-4 col-sm-4 control-label">
                        <div class="form-group">
                            <label class="col-sm-3 col-sm-3 control-label change_content">证件号码</label>
                            <div class="col-sm-9">
                                <span class="form-control baseinfo_content"  readonly style="display: block;
    line-height: 20px;"><?php echo $zjhm_name;?></span>
                            </div>
                        </div>
                    </td>
                    <td>
                    </td>
                </tr>
                <!------------------------------四项基本信息结束------------------------------->

                <!-------------------------员工入司基本信息开始--------------------------->
                <?php if($base_info){ ?>
                <tr>
                    <table class="display table table-bordered" >
                        <tr>
                            <th class="col-sm-6 col-sm-6 label-primary" style="width:14%;background: #669acc;text-align:center;color:#fff;padding:2px;" >
                                <h4 style="font-size:16px;margin:5px">审批操作</h4>
                            </th>
                            <th class="col-sm-6 col-sm-6 label-primary" style="width:16%;background: #669acc;text-align:center;color:#fff;padding:2px;" >
                                <h4 style="font-size:16px;margin:5px">字段名</h4>
                            </th>
                            <th class="col-sm-6 col-sm-6 label-primary" style="width:35%; background: #669acc; text-align: center; color: #fff; padding: 2px;" >
                                <h4 style="font-size:16px;margin:5px">员工基本信息(更改后)</h4>
                            </th>
                            <th class="col-sm-6 col-sm-6 label-primary" style="width:35%;  background: #669acc; text-align: center; color: #fff; padding: 2px;" >
                                <h4 style="font-size:16px;margin:5px">员工基本信息(更改前)</h4>
                            </th>
                        </tr>
                        <?php foreach($base_info['sublist'] as $k=>$v){
                                if($v['type'] != 'FILE'){
                        ?>
                        <tr>
                            <td class="col-sm-3 col-sm-3 control-label" style="text-align:center;width:14%">
                                <div style="padding:0" item="BO_CASC_HR_YGRS" key="<?php echo $k;?>" caption="<?php echo $v['caption'];?>">
                                    <label class="zj sp_result"><input type="radio" <?php if($v['sp_info'] && $v['sp_info']['sp_type']==1) echo 'checked="checked"';?> onclick="base_Approval(this);" value="1">通过</label>&nbsp
                                    <label class="zj sp_result"><input type="radio" <?php if($v['sp_info'] && $v['sp_info']['sp_type']==0) echo 'checked="checked"';?> onclick="base_Approval(this);" value="0">不通过</label>
                                </div>
                            </td>
                            <td class="col-sm-3 col-sm-3 control-label" style="text-align:center;width:16%">
                                <div class="form-group">
                                    <label class="col-sm-12 col-sm-12  change_content" style="cursor:pointer" title="<?php echo $v['caption'];?>"><?php echo mb_substr($v['caption'],0,8,'utf-8');?></label>
                                </div>
                            </td>
                            <td class="col-sm-3 col-sm-3 control-label" style="width:35%">
                                <div class="form-group">
                                    <div class="col-sm-12">
                                        <input class="form-control" style="cursor:pointer" title="<?php echo $v['value'];?>" type="text" name="bumen" value="<?php echo $v['value'];?>" readonly>
                                    </div>
                                </div>
                            </td>
                            <td class="col-sm-3 col-sm-3 control-label" style="width:35%">
                                <div class="form-group">
                                    <div class="col-sm-12">
                                        <input class="form-control" style="cursor:pointer" title="<?php echo $v['oldvalue'];?>" type="text" value="<?php echo $v['oldvalue'];?>" readonly>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <?php   if($v['sp_info'] && $v['sp_info']['sp_type']==0){
                                    $style='style="display:black"';
                                }else{
                                    $style='style="display:none"';
                                }
                        ?>
                        <tr <?php echo $style;?>>
                            <td class="col-sm-3 col-sm-3 control-label"  colspan="15">
                                <div style="position:absolute;color:red;line-height: 27px;">不通过意见:　</div>
                                <div style="position: relative;left:80px;width:1200px;color:red">
                                    <input class="form-control yy" style="cursor:pointer" title="<?php echo $v['sp_info']['reason'];?>" value="<?php if($v['sp_info']['sp_type']==0) echo $v['sp_info']['reason'];?>" type="text" readonly>
                                </div>
                            </td>
                        </tr>
                        <?php }else{
                                if($k != 'ZP'){
                        ?>
                        <tr>
                            <td class="col-sm-3 col-sm-3 control-label" style="text-align:center;width:14%">
                                <div style="padding:0" item="BO_CASC_HR_YGRS" key="<?php echo $k;?>" caption="<?php echo $v['caption'];?>">
                                    <label class="zj sp_result"><input type="radio" <?php if($v['sp_info'] && $v['sp_info']['sp_type']==1) echo 'checked="checked"';?> onclick="base_Approval(this);" value="1">通过</label>&nbsp
                                    <label class="zj sp_result"><input type="radio" <?php if($v['sp_info'] && $v['sp_info']['sp_type']==0) echo 'checked="checked"';?> onclick="base_Approval(this);" value="0">不通过</label>
                                </div>
                            </td>
                            <td class="col-sm-3 col-sm-3 control-label" style="text-align:center;width:16%">
                                <div class="form-group">
                                    <label class="col-sm-12 col-sm-12 change_content" style="cursor:pointer" title="<?php echo $v['caption'];?>"><?php echo mb_substr($v['caption'],0,8,'utf-8');?></label>
                                </div>
                            </td>
                            <td class="col-sm-3 col-sm-3 control-label" style="width:35%">
                                <div class="form-group">
                                    <div class="col-sm-12">
                                        <button class="filebtn get_base_info" val="<?php echo $v['value'];?>" type="edit" >查看</button>
                                    </div>
                                </div>
                            </td>
                            <td class="col-sm-3 col-sm-3 control-label" style="width:35%">
                                <div class="form-group">
                                    <div class="col-sm-12">
                                        <button class="filebtn get_base_info" val="<?php echo $v['value'];?>" type="former" >查看</button>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <?php   if($v['sp_info'] && $v['sp_info']['sp_type']==0){
                                    $style='style="display:black"';
                                }else{
                                    $style='style="display:none"';
                                }
                        ?>
                        <tr <?php echo $style;?>>
                        <td class="col-sm-3 col-sm-3 control-label"  colspan="15">
                            <div style="position: absolute;color:red;line-height: 27px;">不通过意见:　</div>
                            <div style="position: relative;left:80px;width:1200px;color:red">
                                <input class="form-control yy" style="cursor:pointer" title="<?php echo $v['sp_info']['reason'];?>" value="<?php if($v['sp_info']['sp_type']==0) echo $v['sp_info']['reason'];?>" type="text" readonly>
                            </div>
                        </td>
                        </tr>
                        <?php }}} ?>
                    </table>
                </tr>
                <?php } ?>
                <!-------------------------员工入司基本信息结束--------------------------->
            </table>

            <!-------------------------扩展子集开始---------------------------------->
            <?php foreach($zj_info as $k=>$v){
                    $val = $v['value'];
                    $keys = array_keys($val);
            ?>
            <div style="overflow: auto;" class="col">
                <table  class="table table-bordered" >
                    <tr>
                        <td style="background: #669acc; color: #fff; padding: 2px; " >
                            <h4 title="zijibaioji" style="float: left;font-size: 15px;margin:5px"><?php echo $v['caption'];?></h4>
                        </td>
                    </tr>
                    <!---------------------字段名------------------------->
                    <tr class="zd_table">
                        <th><div style="text-align: center;width:62px;">序号</div></th>
                        <th><div style="text-align: center;width:107px;">审批操作</div></th>
                        <th><div style="text-align: center;width:62px;">类型</div></th>
                        <?php foreach($val[$keys[0]]['info'] as $h=>$j){ ?>
                        <th><div style="cursor:pointer;text-align: center;" title="<?php echo $j['caption'];?>"><?php echo mb_substr($j['caption'],0,9,'utf-8');?></div></th>
                        <?php } ?>
                    </tr>
                    <!---------------------数据--------------------------->
                    <?php $xuhao = 0;
                          foreach($val as $f=>$g){
                            $xuhao++;
                            if($g['type']=='insert'){
                                $type_name = '新增';
                            }elseif($g['type']=='update'){
                                $type_name = '更改';
                            }else{
                                $type_name = '删除';
                            }
                    ?>
                    <tr class="gradeX">
                        <td style="text-align: center;width:62px; "><span style="line-height:27px;"><?php echo $xuhao;?></span></td>
                        <td style="text-align: center;width:107px;">
                            <div style="padding:0" item="<?php echo $k;?>" key="<?php echo $f;?>" caption="<?php echo $v['caption'];?>" >
                                <label class="zj"><input type="radio" <?php if($val[$f]['sp_info'] && $val[$f]['sp_info']['sp_type']==1) echo 'checked="checked"';?> onclick="zj_Approval(this);" value="1">通过</label>&nbsp
                                <label class="zj"><input type="radio" <?php if($val[$f]['sp_info'] && $val[$f]['sp_info']['sp_type']==0) echo 'checked="checked"';?> onclick="zj_Approval(this);" value="0">不通过</label>
                            </div>
                        </td>
                        <td style="text-align: center;width: 62px;"><span style="line-height:27px;"><?php echo $type_name; ?></span></td>
                        <?php foreach($g['info'] as $a=>$b){
                                if($b['change_type']==1 && $g['type']=='update'){
                                    $style = 'style="color:red;cursor:pointer;display:block;margin: 0 auto;"';
                                    $class = 'class="up"';
                                }else{
                                    $style = 'style=":cursor:pointer;display: block;margin: 0 auto;"';;
                                    $class = '';
                                }
                        ?>
                        <td>
                            <?php if($b['type']=='FILE'){
                                    if($b['change_type']==1 && $g['type']=='update'){
                                        $style = 'style="color:red;"';
                                    }else{
                                        $style = '';
                                    }
                            ?>
                                <button class="filebtn get_zj_file " type="<?php echo $g['type'];?>" val="<?php echo $b['value'];?>" <?php echo $style; ?> >查看</button>
                            <?php }else{ ?>
                                <input type="text" title="<?php echo $b['value'];?>" <?php echo $style; echo $class; ?> zd_name="<?php echo $b['caption']; ?>" oldval="<?php echo $b['oldvalue'];?>" value="<?php echo $b['value'];?>" readonly>
                            <?php } ?>
                        </td>
                        <?php } ?>
                    </tr>
                    <?php if($val[$f]['sp_info'] && $val[$f]['sp_info']['sp_type']==0){
                            $style='style="display:black"';
                          }else{
                            $style='style="display:none"';
                          }
                    ?>
                    <tr <?php echo $style;?>>
                        <td class="col-sm-3 col-sm-3 control-label"  colspan="15">
                            <div style="float:left;color:red;line-height: 27px;">不通过意见:　</div>
                            <div style="float: left;width:1200px;color:red">
                                <input class="form-control yy" style="cursor:pointer" title="<?php echo $val[$f]['sp_info']['reason'];?>" value="<?php echo $val[$f]['sp_info']['reason'];?>" type="text" disabled>
                            </div>
                        </td>
                    </tr>
                    <?php } ?>
                </table>
            </div>
            <?php } ?>
            <!-------------------------扩展子集结束---------------------------------->
        </div>
    </div>
</section>
</body>
<script>
    var awsid = $('#awsid').val();
    var jd_bs = {$jd_bs};
    var status = '{$status}';
    //提交审核
    function setApproval(data){
        var flng = false;
        $.ajax({
            url : '__CONTROLLER__/ajax_setApproval',
            data : data,
            type : 'post',
            dataType : 'json',
            async : false,
            success : function(e){
                if(e == 'ok'){
                    flng = true;
                }
            }
        });
        return flng;
    }

    //员工基本信息提交审核
    function base_Approval(a) {
        var self = $(a);
        var item = $(a).parent().parent().attr('item');
        var key = $(a).parent().parent().attr('key');
        var caption = $(a).parent().parent().attr('caption');
        var type = $(a).val();
        var next_html = $(a).parent().parent().parent().parent().next();

        if(self.attr('checked')){
            if(type == 1){
                layer.msg('不能重复相同的审批动作!');
                return;
            }
        }
        if(type == 1){
            //通过
            var data  = {awsid:awsid,item:item,caption:caption,type:type,key:key};
            var flng = setApproval(data);
            if(flng){
                next_html.hide();
                self.attr('checked',true);
                self.parent().next().find('input').attr('checked',false);
                layer.msg('操作成功!');
            }
        }else if(type == 0){
            //不通过
            //获取之前的不通过意见
            var oldval = next_html.find($('input')).val();
            layer.prompt({
                formType: 2,
                title: '请输入此项不通过的意见',
                value: oldval,
                btn2: function(){
                    if(!self.attr('checked') && !self.parent().prev().find('input').attr('checked')){
                        self.attr('checked',false);
                    }else if(self.parent().prev().find('input').attr('checked')){
                        self.attr('checked',false);
                        self.parent().prev().find('input').attr('checked',true);
                    }
                },
                cancel:function(){
                    if(!self.attr('checked') && !self.parent().prev().find('input').attr('checked')){
                        self.attr('checked',false);
                    }else if(self.parent().prev().find('input').attr('checked')){
                        self.attr('checked',false);
                        self.parent().prev().find('input').attr('checked',true);
                    }
                }
            }, function(value, index){
                var data  = {awsid:awsid,item:item,caption:caption,val:value,type:type,key:key};
                var flng = setApproval(data);
                if(flng){
                    next_html.find('input').val(value);
                    next_html.show();
                    self.attr('checked',true);
                    self.parent().prev().find('input').attr('checked',false);
                    layer.msg('操作成功');
                    layer.close(index);
                }
            });
        }
    }

    //子集审批提交
    function zj_Approval(a){
        var self = $(a);
        var item = $(a).parent().parent().attr('item');
        var key = $(a).parent().parent().attr('key');
        var caption = $(a).parent().parent().attr('caption');
        var type = $(a).val();
        var next_html = $(a).parent().parent().parent().parent().next();
        if(self.attr('checked')){
            if(type == 1){
                layer.msg('不能重复相同的审批动作!');
                return;
            }
        }
        if(type == 1){
            //通过
            var data  = {awsid:awsid,item:item,caption:caption,type:type,key:key};
            var flng = setApproval(data);
            if(flng){
                next_html.hide();
                self.attr('checked',true);
                self.parent().next().find('input').attr('checked',false);
                layer.msg('操作成功!');
            }
        }else if(type == 0){
            //不通过
            //获取之前的不通过意见
            var oldval = next_html.find($('input')).val();
            layer.prompt({
                formType: 2,
                title : '请输入此记录不通过的原因',
                value : oldval,
                btn2: function(){
                    if(!self.attr('checked') && !self.parent().prev().find('input').attr('checked')){
                        self.attr('checked',false);
                    }else if(self.parent().prev().find('input').attr('checked')){
                        self.attr('checked',false);
                        self.parent().prev().find('input').attr('checked',true);
                    }
                },
                cancel:function(){
                    if(!self.attr('checked') && !self.parent().prev().find('input').attr('checked')){
                        self.attr('checked',false);
                    }else if(self.parent().prev().find('input').attr('checked')){
                        self.attr('checked',false);
                        self.parent().prev().find('input').attr('checked',true);
                    }
                }
            }, function(value, index){
                var data  = {awsid:awsid,item:item,caption:caption,val:value,type:type,key:key};
                var flng = setApproval(data);
                if(flng){
                    next_html.find($('input')).val(value);
                    next_html.show();
                    self.attr('checked',true);
                    self.parent().prev().find('input').attr('checked',false);
                    layer.msg('操作成功');
                    layer.close(index);
                }
            });
        }
    }


    $(function(){
        //判断当前账号的审批状态,如果已经审批过,禁止操作
        if(jd_bs != 1  ){
            $('input[type=radio]').attr('disabled',true);
        }else{
            if(status === 'TRUE'){
                $('input[type=radio]').attr('disabled',true);
            }
        }

        var col = $('.col').find('table').find('tr:eq(1)').find('th');
        $('.col').find('table').find('tr:eq(0)').find('td:eq(0)').attr('colspan',col.length);
        $('.col').find('table').find('tr:last').find('td:eq(0)').attr('colspan',col.length);

        $('.shows').parents('table').find('tr:gt(0)').hide();


        /****************************查看修改之前的数据***************************/
        $('.up').click(function(){
            var zd_name = $(this).attr('zd_name');
            var oldval = $(this).attr('oldval');
            var val = $(this).val();
            //alert(oldval);return;
            layer.open({
                type: 1,
                title: false, //不显示标题栏
                closeBtn: false,
                area: '400px;',
                shade: 0.8,
                id: 'LAY_layuipro', //设定一个id，防止重复弹出
                btn: ['确定'],
                moveType: 1 ,//拖拽模式，0或者1
                content: '<div style="padding: 50px;line-height:22px;color:black;" class="layer_input"><div style="text-align:center;font-size:18px;"><span>'+zd_name+'</span></div><br><div class="form-group"><label class="col-sm-3 col-sm-3 control-label">修改后</label><div class="col-sm-9"><input style="color:black;cursor:pointer" title="'+val+'" class="form-control" value="'+val+'" type="text" readonly></div></div><br><div class="form-group"><label class="col-sm-3 col-sm-3 control-label" >修改前</label><div class="col-sm-9"><input class="form-control" style="color:black;cursor:pointer" title="'+oldval+'" type="text" value="'+oldval+'" readonly></div></div>',
                success: function(layero){
                    var btn = layero.find('.layui-layer-btn');
                    btn.css('text-align', 'center');
                }
            });

        })
    });
    $('.get_base_info').click(function(){
        var type = $(this).attr('type');
        var val = $(this).attr('val');
        if(val){
            val = val.split('--');
            //var html = '<table class="table table-hover file_area"><tr><td>2.pdf</td><td class="file_handle"><span>新增</span><span><a href="">下载</a></span></td></tr></table>';
            var html = '<table class="table table-hover file_area">';
            for(var i=0;i<val.length;i++){
                var _v = val[i].split('@@');
                if(type == 'former'){
                    if(_v[2] != 4){
                        html += '<tr><td>'+_v[0]+'</td><td class="file_handle"><span><a href="'+_v[1]+'">下载</a></span></td></tr>';
                    }
                }else{
                    if(_v[2] ==1){
                        var zt = '原有';
                    }else if(_v[2] == 2){
                        var zt = '新增';
                    }else if(_v[2] == 3){
                        var zt = '修改';
                    }else if(_v[2] == 4){
                        var zt = '删除';
                    }
                    html += '<tr><td>'+_v[0]+'</td><td class="file_handle"><span>'+zt+'</span>　<span><a href="'+_v[1]+'">下载</a></span></td></tr>'
                }
            }
            html += '</table>';
            layer.alert(html, {
                title:'查看附件',
                area: '550px',
                skin: 'layui-layer-molv' //样式类名
                ,closeBtn: 0
            });
        }else{
            layer.msg('无附件信息');
        }

    });
    $('.get_zj_file').click(function(){
        var val = $(this).attr('val');
        var type = $(this).attr('type');
        if(val){
            val = val.split('--');
            var html = '<table class="table table-hover file_area">';
            for(var i=0;i<val.length;i++){
                var _v = val[i].split('@@');
                if(type == 'delete'){
                    if(_v[2] != 2){
                        html += '<tr><td>'+_v[0]+'</td><td class="file_handle"><span><a href="'+_v[1]+'">下载</a></span></td></tr>';
                    }
                }else{
                    if(_v[2] ==1){
                        var zt = '原有';
                    }else if(_v[2] == 2){
                        var zt = '新增';
                    }else if(_v[2] == 3){
                        var zt = '修改';
                    }else if(_v[2] == 4){
                        var zt = '删除';
                    }
                    html += '<tr><td>'+_v[0]+'</td><td class="file_handle"><span>'+zt+'</span>　<span><a href="'+_v[1]+'">下载</a></span></td></tr>'
                }
            }
            html += '</table>';
            layer.alert(html, {
                title:'查看附件',
                area: '550px',
                skin: 'layui-layer-molv' //样式类名
                ,closeBtn: 0
            });
        }else{
            layer.msg('无附件信息');
        }
    })
</script>
</html>


